package com.base.self.controller;


import com.base.log.LoginAn;
import com.base.result.ResponseResult;
import com.base.self.dto.selfOrderComment.SelfOrderCommentWebListDTO;
import com.base.self.service.ISelfOrderCommentService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

/**
 * <p>
 * 晒单 前端控制器
 * </p>
 *
 * @author XiFYuW
 * @since 2020-12-05
 */
@RestController
@RequestMapping("/admin/selfOrderComment")
public class SelfOrderCommentController {

    private final ISelfOrderCommentService iSelfOrderCommentService;

    public SelfOrderCommentController(ISelfOrderCommentService iSelfOrderCommentService) {
        this.iSelfOrderCommentService = iSelfOrderCommentService;
    }

    @GetMapping(value = "/selfOrderCommentIndex")
    @LoginAn
    public ModelAndView selfOrderCommentIndex() {
        return new ModelAndView("self/index_self_order_comment");
    }

    @PostMapping(value = "/selfOrderCommentWebList")
    @Validated
    @LoginAn(isRe = true)
    public ResponseResult selfOrderCommentWebList(@Valid final SelfOrderCommentWebListDTO selfOrderCommentWebListDTO) {
        return iSelfOrderCommentService.selfOrderCommentWebList(selfOrderCommentWebListDTO);
    }
}

